package com.lujieni.dubboprovider.service.impl;

import com.lujieni.dubbointerface.HelloService;
import com.lujieni.po.UserPO;
import org.apache.dubbo.config.annotation.DubboService;
import java.util.concurrent.TimeUnit;

@DubboService
public class HelloServcieImpl implements HelloService {

    private int count = 0;


    public String sayHello(String name) {
        System.out.println("调用:"+(++count));
        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "fuck" + name;
    }

    public UserPO getUserById(Integer id) {
        return new UserPO("风筝", id);
    }

    public String getNo() {
        //throw new RpcException();
        //return "2";
        System.out.println("AAAAAAAAAAAAAAAAAAAA");
      /*  try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }*/
        int i =  5 / 0;
        return "2";
    }

}
